package com.bocloud.cmp.service.resource;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bocloud.cmp.dao.RegionDao;
import com.bocloud.cmp.entity.resource.Region;
import com.bocloud.cmp.interfaces.resource.RegionService;
import com.bocloud.common.model.BsmResult;

/**
 * 区域抽象Service接口实现
 * 
 * @author dongkai
 *
 */
@Service("regionService")
public class RegionServiceImpl implements RegionService {

	private static Logger logger = LoggerFactory.getLogger(RegionServiceImpl.class);
	@Autowired
	private RegionDao regionDao;

	@Override
	public BsmResult list(Long id) {
		try {
			List<Region> list = regionDao.list(id);
			return new BsmResult(true, list, "查询成功!");
		} catch (Exception e) {
			logger.error("list region failure:", e);
			return new BsmResult(false, "查询失败!");
		}
	}

}
